<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>

    .box {
        height: 500px;
        width: 500px;
        background-color: pink;
        color:blue
    }

</style>
<body>
    <div>123</div>
    账号： <input type="text" name="" id=""> <br>
    密码：<input type="text" name="" id=""> <br>
    <button>确认</button>
    <script>
        let div = document.querySelector('div')
        div.className  = 'box'

        // 通过classList增加类
        const boxClass = document.querySelector('.box')
        boxClass.classList.add('nav')
    </script>
</body>
</html>